<script type="text/javascript">

//
$(document).ready();

function deleteItem(id, rma_id) {
	if(confirm('Delete record?')){ 
			$.ajax({url:'/rma/deleteitems/id/'+id,success:function(data){alert('Item has been removed');location.href=('/rma/additems/id/'+rma_id);}});
		}  
}

</script>
<?php $this->jQuery()->onLoadCaptureStart(); ?>
				jQuery('#inventoryItem').change(function() 
				{ 
					$.post('/ajax/getitemdesc/inventoryItem/'+$('#inventoryItem').val(),{}, 
					function(data) {
	
							$('#inventoryItemDesc').val(data['inventoryItemDesc'])
					
					}, 'json');
				});
								
	<?php $this->jQuery()->onLoadCaptureEnd(); ?>

<div id="content">
<h1><?php echo $this->pageTitle; ?></h1>
<table border="0">
	<tr>
		<td>Customer: </td>
		<td><?php echo $this->rmaInfo[0]['partyNumber']; ?></td>
	</tr>
	<tr>
		<td>Outlet: </td>
		<td><?php echo $this->rmaInfo[0]['sapCode']; ?></td>
	</tr>
	<tr>
		<td>Reference#: </td>
		<td><?php echo $this->rmaInfo[0]['reference']; ?></td>
	</tr>
</table>
<p>
		<?php if($this->rmaItems)
				{
					echo '<div id="normaltable">
							<table>
								<thead>
									<tr>
										<th>InventoryItem</th>
										<th>InventoryItemDesc</th>
										<th>Quantity</th>
										<th></th>
									</tr>
								</thead>
								<tbody>';
					foreach ($this->rmaItems as $row) {
						echo "<tr>";
						echo "<td>".$row['inventoryItem']."</td>";
						echo "<td></td>";
						echo "<td>".$row['rmaQuantity']."</td>";
						echo '<td><a href="#" onClick="deleteItem('.$row["id"].','.$row["rma_id"].')">delete</a></td>';
						echo "</tr>";
					}
					
					echo '	</tbody>
						</table>
						</div>';
				}
		?>
<font color="#FF0000"><?php echo $this->errorMsg; ?></font>
<p><br><br>
<?php echo $this->form; ?>
</div>